package com.ssh.action;

import com.opensymphony.xwork2.ActionSupport;
import com.ssh.entity.User;
import com.ssh.service.UserService;

public class UserAction extends ActionSupport {
	private int userId;
	private User user;
	// service
	public UserService userService;

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	public String execute() throws Exception {
		// 通过接受到的id来查询用户
		user = userService.getUserById(userId);
		return SUCCESS;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
}
